# Build the manager binary
FROM golang:1.17 as builder

WORKDIR /app
COPY . /app

RUN go env -w GO111MODULE=on \
    && go env -w GOPROXY=https://goproxy.cn,direct \
    && go mod download \
    && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o configctl .

FROM alpine:latest

WORKDIR /go-app

COPY --from=builder /app/configctl /go-app/configctl

ENTRYPOINT ["sleep 10000000"]